package com.ynny.chapter14.bean;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class R {
    private int code;
    private String msg;
    private Object data;

    public static R ok(Object data) {
        return new R(200, "请求成功", data);
    }
    public static R error(Object data) {
        return new R(500, "请求失败", data);
    }
}
